﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
using Bovespa.Infra.Security;
using Bovespa.Infra.Web.Composite;
using Bovespa.Infra.Web.Composite.Interfaces;
using Bovespa.CAS.Shell.App_Data;

namespace Bovespa.CAS.Shell.Presenters
{
    /// <summary>
    /// Classe publica de controle do presenter ServerSideConfirm
    /// </summary>
    public class ConfirmPresenter : Presenter<IConfirm>
    {
        #region Campos

        #endregion

        #region Membros Publicos

        #region Propriedades

        #endregion

        #region Metodos

        public override void OnViewInitialized()
        {
            View.EnableAuthorization = false;
            View.EnableMenu = false;

            base.OnViewInitialized();
        }

        /// <summary>
        /// Carrega informacoes iniciais da View
        /// </summary>
        public override void OnViewLoaded()
        {
            View.EnableAuthorization = false;
            View.EnableMenu = false;

            base.OnViewLoaded();
        }

        /// <summary>
        /// Retorna todos os produtos
        /// </summary>
        /// <returns></returns>
        public List<Product> GetProducts()
        {
            //Aqui deve ser feita a chamada do serviço
            return Products.GetAll();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="productId"></param>
        public void RemoveProduct(int productId)
        {
            //Aqui deve ser feita a chamada do serviço
            Products.Remove(productId);
        }

        #endregion

        #endregion

        #region Metodos Privados

        #endregion
    }
}
